﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2012/2/23 0:20:21
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Restaurant.EntityType;
using Sector7.Framework.Core;

namespace Sector7.Restaurant.DAO
{
    /// <summary>
    /// 销售单数据访问接口
    /// </summary>
    public interface ISalesBillDAO
    {
        /// <summary>
        /// 创建销售单据
        /// </summary>
        /// <param name="bill">销售单</param>
        /// <returns></returns>
        int Create(RS_SalesBill bill);

        /// <summary>
        /// 根据桌位编号读取单据信息
        /// </summary>
        /// <param name="tableId">桌位编号</param>
        /// <returns></returns>
        RS_SalesBill Read(int tableId);

        /// <summary>
        /// 更新销售单据信息
        /// </summary>
        /// <param name="delta">单据变化量</param>
        /// <returns></returns>
        int Update(EntityDelta delta);

        /********************************************************/

        /// <summary>
        /// 根据销售单据号读取单据信息
        /// </summary>
        /// <param name="billId">销售单据号</param>
        /// <returns></returns>
        RS_SalesBill Read(string billId);

        /// <summary>
        /// 根据状态读取所有单据
        /// </summary>
        /// <param name="isDone">是否完成</param>
        /// <returns></returns>
        List<RS_SalesBill> ReadAll(bool isDone);

        /// <summary>
        /// 根据单据号获取所有单据
        /// </summary>
        /// <param name="billIds">单据号</param>
        /// <returns></returns>
        List<RS_SalesBill> ReadAll(params int[] billIds);

        /// <summary>
        /// 根据编号删除销售单据
        /// </summary>
        /// <param name="billId">销售单据号</param>
        /// <returns></returns>
        DBOptResultType Delete(string billId);
    }
}
